package 考试.Question12;

import java.time.Duration;
import java.time.LocalDateTime;

/**
 * 计算现在距离今年大年初一（2026年1月22日0点0分0秒）
 * 还有多少天，多少小时，多少分钟，多少秒？
 */
public class Date1 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime date = LocalDateTime.of(2026,1,22,0,0,0);
        Duration duration = Duration.between(now,date);
        long days = duration.toDays();
        long hours = (duration.toHours() % 24);
        long minutes = (duration.toMinutes() % 60);
        long seconds = (duration.getSeconds() % 60);
        System.out.println("距离今年大年初一还有"+days+"天"+hours+"小时"+minutes+"分钟"+seconds+"秒");

    }

}